﻿using Jay.Sc2.Bof.Lib.State;

namespace Jay.Sc2.Bof.Lib.Action.Terran
{
	public class ActionProduceSupplyDepot : ActionProduceFromSCV
	{
		public static ActionProduceSupplyDepot Instance = new ActionProduceSupplyDepot();

		private ActionProduceSupplyDepot() : base(30, 100, 0) { }

		public override string EventName { get { return "ActionSpawnSupplyDepot"; } }
		public override bool HaveTechnology(IBuildOrder bo) { return true; }

		public override TerranState.TerranBuilding GetBuilding(TerranState state) { return state.SupplyDepot; }

		public override void OnProductionFinished(IBuildOrder bo)
		{
			base.OnProductionFinished(bo);
			TerranState state = bo.State as TerranState;
			state.Supply += 8;
			state.m_SupplyBuilding -= 8;
		}

		public override void OnProductionStart(IBuildOrder bo)
		{
			base.OnProductionStart(bo);
			TerranState state = bo.State as TerranState;
			state.m_SupplyBuilding += 8;
		}
	}
}
